import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_jd/tools/utils/library.dart';

/// 全局静态数据
class Global {
  /// 初始化
  static Future init() async {
    WidgetsFlutterBinding.ensureInitialized(); // 运行初始
    await StorageUtil().init(); // Storage 初始化
    setDeviceOrientation();
  }

  // 设备方向
  static setDeviceOrientation() async {
    await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown
    ]);
  }
}
